<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoupCookie</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="SoupAuthDomainDigest.html" title="SoupAuthDomainDigest">
<link rel="next" href="SoupMessage.html" title="SoupMessage">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="SoupAuthDomainDigest.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="SoupMessage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#SoupCookie.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#SoupCookie.description" class="shortcut">Description</a>
                   | 
                  <a href="#SoupCookie.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="SoupCookie"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="SoupCookie.top_of_page"></a>SoupCookie</span></h2>
<p>SoupCookie — HTTP Cookies</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="SoupCookie.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libsoup/soup.h&gt;

                    <a class="link" href="SoupCookie.html#SoupCookie-struct" title="SoupCookie">SoupCookie</a>;
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        <a class="link" href="SoupCookie.html#soup-cookie-new" title="soup_cookie_new ()">soup_cookie_new</a>                     (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *value</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *domain</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_age</code></em>);
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        <a class="link" href="SoupCookie.html#soup-cookie-parse" title="soup_cookie_parse ()">soup_cookie_parse</a>                   (<em class="parameter"><code>const <span class="type">char</span> *header</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a> *origin</code></em>);
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        <a class="link" href="SoupCookie.html#soup-cookie-copy" title="soup_cookie_copy ()">soup_cookie_copy</a>                    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-free" title="soup_cookie_free ()">soup_cookie_free</a>                    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-name" title="soup_cookie_set_name ()">soup_cookie_set_name</a>                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="SoupCookie.html#soup-cookie-get-name" title="soup_cookie_get_name ()">soup_cookie_get_name</a>                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-value" title="soup_cookie_set_value ()">soup_cookie_set_value</a>               (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *value</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="SoupCookie.html#soup-cookie-get-value" title="soup_cookie_get_value ()">soup_cookie_get_value</a>               (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-domain" title="soup_cookie_set_domain ()">soup_cookie_set_domain</a>              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *domain</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="SoupCookie.html#soup-cookie-get-domain" title="soup_cookie_get_domain ()">soup_cookie_get_domain</a>              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-path" title="soup_cookie_set_path ()">soup_cookie_set_path</a>                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *path</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="SoupCookie.html#soup-cookie-get-path" title="soup_cookie_get_path ()">soup_cookie_get_path</a>                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()">soup_cookie_set_max_age</a>             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_age</code></em>);
#define             <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-HOUR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_HOUR">SOUP_COOKIE_MAX_AGE_ONE_HOUR</a>
#define             <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-DAY:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_DAY">SOUP_COOKIE_MAX_AGE_ONE_DAY</a>
#define             <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-WEEK:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_WEEK">SOUP_COOKIE_MAX_AGE_ONE_WEEK</a>
#define             <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-YEAR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_YEAR">SOUP_COOKIE_MAX_AGE_ONE_YEAR</a>
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-expires" title="soup_cookie_set_expires ()">soup_cookie_set_expires</a>             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html#SoupDate"><span class="type">SoupDate</span></a> *expires</code></em>);
<a class="link" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html#SoupDate"><span class="returnvalue">SoupDate</span></a> *          <a class="link" href="SoupCookie.html#soup-cookie-get-expires" title="soup_cookie_get_expires ()">soup_cookie_get_expires</a>             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-secure" title="soup_cookie_set_secure ()">soup_cookie_set_secure</a>              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> secure</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="SoupCookie.html#soup-cookie-get-secure" title="soup_cookie_get_secure ()">soup_cookie_get_secure</a>              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookie-set-http-only" title="soup_cookie_set_http_only ()">soup_cookie_set_http_only</a>           (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> http_only</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="SoupCookie.html#soup-cookie-get-http-only" title="soup_cookie_get_http_only ()">soup_cookie_get_http_only</a>           (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="SoupCookie.html#soup-cookie-applies-to-uri" title="soup_cookie_applies_to_uri ()">soup_cookie_applies_to_uri</a>          (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a> *uri</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="SoupCookie.html#soup-cookie-domain-matches" title="soup_cookie_domain_matches ()">soup_cookie_domain_matches</a>          (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *host</code></em>);

<span class="returnvalue">char</span> *              <a class="link" href="SoupCookie.html#soup-cookie-to-cookie-header" title="soup_cookie_to_cookie_header ()">soup_cookie_to_cookie_header</a>        (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);
<span class="returnvalue">char</span> *              <a class="link" href="SoupCookie.html#soup-cookie-to-set-cookie-header" title="soup_cookie_to_set_cookie_header ()">soup_cookie_to_set_cookie_header</a>    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            <a class="link" href="SoupCookie.html#soup-cookies-from-request" title="soup_cookies_from_request ()">soup_cookies_from_request</a>           (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            <a class="link" href="SoupCookie.html#soup-cookies-from-response" title="soup_cookies_from_response ()">soup_cookies_from_response</a>          (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookies-to-request" title="soup_cookies_to_request ()">soup_cookies_to_request</a>             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookies-to-response" title="soup_cookies_to_response ()">soup_cookies_to_response</a>            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);
<span class="returnvalue">char</span> *              <a class="link" href="SoupCookie.html#soup-cookies-to-cookie-header" title="soup_cookies_to_cookie_header ()">soup_cookies_to_cookie_header</a>       (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupCookie.html#soup-cookies-free" title="soup_cookies_free ()">soup_cookies_free</a>                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="SoupCookie.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GBoxed
   +----SoupCookie
</pre>
</div>
<div class="refsect1">
<a name="SoupCookie.description"></a><h2>Description</h2>
<p>
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> implements HTTP cookies, primarily as described by
<a class="ulink" href="http://wp.netscape.com/newsref/std/cookie_spec.html" target="_top">the
original Netscape cookie specification</a>, but with slight
modifications based on <a class="ulink" href="http://www.ietf.org/rfc/rfc2109.txt" target="_top">RFC 2109</a>, <a class="ulink" href="http://msdn2.microsoft.com/en-us/library/ms533046.aspx" target="_top">Microsoft's
HttpOnly extension attribute</a>, and observed real-world usage
(and, in particular, based on what Firefox does).
</p>
<p>
To have a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> handle cookies for your appliction
automatically, use a <a class="link" href="SoupCookieJar.html" title="SoupCookieJar"><span class="type">SoupCookieJar</span></a>.
</p>
</div>
<div class="refsect1">
<a name="SoupCookie.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SoupCookie-struct"></a><h3>SoupCookie</h3>
<pre class="programlisting">typedef struct {
	char     *name;
	char     *value;
	char     *domain;
	char     *path;
	SoupDate *expires;
	gboolean  secure;
	gboolean  http_only;
} SoupCookie;
</pre>
<p>
An HTTP cookie.
</p>
<p>
<em class="parameter"><code>name</code></em> and <em class="parameter"><code>value</code></em> will be set for all cookies. If the cookie is
generated from a string that appears to have no name, then <em class="parameter"><code>name</code></em>
will be the empty string.
</p>
<p>
<em class="parameter"><code>domain</code></em> and <em class="parameter"><code>path</code></em> give the host or domain, and path within that
host/domain, to restrict this cookie to. If <em class="parameter"><code>domain</code></em> starts with
".", that indicates a domain (which matches the string after the
".", or any hostname that has <em class="parameter"><code>domain</code></em> as a suffix). Otherwise, it
is a hostname and must match exactly.
</p>
<p>
<em class="parameter"><code>expires</code></em> will be non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the cookie uses either the original
"expires" attribute, or the "max-age" attribute specified in RFC
2109. If <em class="parameter"><code>expires</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, it indicates that neither "expires" nor
"max-age" was specified, and the cookie expires at the end of the
session.
</p>
<p>
If <em class="parameter"><code>http_only</code></em> is set, the cookie should not be exposed to untrusted
code (eg, javascript), so as to minimize the danger posed by
cross-site scripting attacks.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><span class="type">char</span> *<em class="structfield"><code><a name="SoupCookie-struct.name"></a>name</code></em>;</span></p></td>
<td>the cookie name</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">char</span> *<em class="structfield"><code><a name="SoupCookie-struct.value"></a>value</code></em>;</span></p></td>
<td>the cookie value</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">char</span> *<em class="structfield"><code><a name="SoupCookie-struct.domain"></a>domain</code></em>;</span></p></td>
<td>the "domain" attribute, or else the hostname that the
cookie came from.</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">char</span> *<em class="structfield"><code><a name="SoupCookie-struct.path"></a>path</code></em>;</span></p></td>
<td>the "path" attribute, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html#SoupDate"><span class="type">SoupDate</span></a> *<em class="structfield"><code><a name="SoupCookie-struct.expires"></a>expires</code></em>;</span></p></td>
<td>the cookie expiration time, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for a session cookie</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="SoupCookie-struct.secure"></a>secure</code></em>;</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the cookie should only be tranferred over SSL</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="SoupCookie-struct.http-only"></a>http_only</code></em>;</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the cookie should not be exposed to scripts</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-new"></a><h3>soup_cookie_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        soup_cookie_new                     (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *value</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *domain</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_age</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> with the given attributes. (Use
<a class="link" href="SoupCookie.html#soup-cookie-set-secure" title="soup_cookie_set_secure ()"><code class="function">soup_cookie_set_secure()</code></a> and <a class="link" href="SoupCookie.html#soup-cookie-set-http-only" title="soup_cookie_set_http_only ()"><code class="function">soup_cookie_set_http_only()</code></a> if you
need to set those attributes on the returned cookie.)
</p>
<p>
<em class="parameter"><code>max_age</code></em> is used to set the "expires" attribute on the cookie; pass
-1 to not include the attribute (indicating that the cookie expires
with the current session), 0 for an already-expired cookie, or a
lifetime in seconds. You can use the constants
<a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-HOUR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_HOUR"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_HOUR</code></a>, <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-DAY:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_DAY"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_DAY</code></a>,
<a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-WEEK:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_WEEK"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_WEEK</code></a> and <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-YEAR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_YEAR"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_YEAR</code></a> (or
multiples thereof) to calculate this value. (If you really care
about setting the exact time that the cookie will expire, use
<a class="link" href="SoupCookie.html#soup-cookie-set-expires" title="soup_cookie_set_expires ()"><code class="function">soup_cookie_set_expires()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>cookie name</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>cookie value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>cookie domain or hostname</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>cookie path, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_age</code></em> :</span></p></td>
<td>max age of the cookie, or -1 for a session cookie</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-parse"></a><h3>soup_cookie_parse ()</h3>
<pre class="programlisting"><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        soup_cookie_parse                   (<em class="parameter"><code>const <span class="type">char</span> *header</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a> *origin</code></em>);</pre>
<p>
Parses <em class="parameter"><code>header</code></em> and returns a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>. (If <em class="parameter"><code>header</code></em> contains
multiple cookies, only the first one will be parsed.)
</p>
<p>
If <em class="parameter"><code>header</code></em> does not have "path" or "domain" attributes, they will
be defaulted from <em class="parameter"><code>origin</code></em>. If <em class="parameter"><code>origin</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, path will default
to "/", but domain will be left as <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Note that this is not a
valid state for a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>, and you will need to fill in some
appropriate string for the domain if you want to actually make use
of the cookie.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>a cookie string (eg, the value of a Set-Cookie header)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>origin</code></em> :</span></p></td>
<td>origin of the cookie, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it could not be
parsed, or contained an illegal "domain" attribute for a cookie
originating from <em class="parameter"><code>origin</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-copy"></a><h3>soup_cookie_copy ()</h3>
<pre class="programlisting"><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="returnvalue">SoupCookie</span></a> *        soup_cookie_copy                    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Copies <em class="parameter"><code>cookie</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a copy of <em class="parameter"><code>cookie</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-free"></a><h3>soup_cookie_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_free                    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Frees <em class="parameter"><code>cookie</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-name"></a><h3>soup_cookie_set_name ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_name                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s name to <em class="parameter"><code>name</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>the new name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-name"></a><h3>soup_cookie_get_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        soup_cookie_get_name                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s name
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-value"></a><h3>soup_cookie_set_value ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_value               (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s value to <em class="parameter"><code>value</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the new value</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-value"></a><h3>soup_cookie_get_value ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        soup_cookie_get_value               (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s value
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s value</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-domain"></a><h3>soup_cookie_set_domain ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_domain              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *domain</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s domain to <em class="parameter"><code>domain</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the new domain</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-domain"></a><h3>soup_cookie_get_domain ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        soup_cookie_get_domain              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s domain
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s domain</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-path"></a><h3>soup_cookie_set_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_path                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *path</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s path to <em class="parameter"><code>path</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>the new path</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-path"></a><h3>soup_cookie_get_path ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        soup_cookie_get_path                (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s path
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s path</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-max-age"></a><h3>soup_cookie_set_max_age ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_max_age             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_age</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s max age to <em class="parameter"><code>max_age</code></em>. If <em class="parameter"><code>max_age</code></em> is -1, the cookie
is a session cookie, and will expire at the end of the client's
session. Otherwise, it is the number of seconds until the cookie
expires. You can use the constants <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-HOUR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_HOUR"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_HOUR</code></a>,
<a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-DAY:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_DAY"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_DAY</code></a>, <a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-WEEK:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_WEEK"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_WEEK</code></a> and
<a class="link" href="SoupCookie.html#SOUP-COOKIE-MAX-AGE-ONE-YEAR:CAPS" title="SOUP_COOKIE_MAX_AGE_ONE_YEAR"><code class="literal">SOUP_COOKIE_MAX_AGE_ONE_YEAR</code></a> (or multiples thereof) to calculate
this value. (A value of 0 indicates that the cookie should be
considered already-expired.)
</p>
<p>
(This sets the same property as <a class="link" href="SoupCookie.html#soup-cookie-set-expires" title="soup_cookie_set_expires ()"><code class="function">soup_cookie_set_expires()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_age</code></em> :</span></p></td>
<td>the new max age</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-COOKIE-MAX-AGE-ONE-HOUR:CAPS"></a><h3>SOUP_COOKIE_MAX_AGE_ONE_HOUR</h3>
<pre class="programlisting">#define SOUP_COOKIE_MAX_AGE_ONE_HOUR (60 * 60)
</pre>
<p>
A constant corresponding to 1 hour, for use with <a class="link" href="SoupCookie.html#soup-cookie-new" title="soup_cookie_new ()"><code class="function">soup_cookie_new()</code></a>
and <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()"><code class="function">soup_cookie_set_max_age()</code></a>.
</p>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-COOKIE-MAX-AGE-ONE-DAY:CAPS"></a><h3>SOUP_COOKIE_MAX_AGE_ONE_DAY</h3>
<pre class="programlisting">#define SOUP_COOKIE_MAX_AGE_ONE_DAY  (SOUP_COOKIE_MAX_AGE_ONE_HOUR * 24)
</pre>
<p>
A constant corresponding to 1 day, for use with <a class="link" href="SoupCookie.html#soup-cookie-new" title="soup_cookie_new ()"><code class="function">soup_cookie_new()</code></a>
and <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()"><code class="function">soup_cookie_set_max_age()</code></a>.
</p>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-COOKIE-MAX-AGE-ONE-WEEK:CAPS"></a><h3>SOUP_COOKIE_MAX_AGE_ONE_WEEK</h3>
<pre class="programlisting">#define SOUP_COOKIE_MAX_AGE_ONE_WEEK (SOUP_COOKIE_MAX_AGE_ONE_DAY * 7)
</pre>
<p>
A constant corresponding to 1 week, for use with <a class="link" href="SoupCookie.html#soup-cookie-new" title="soup_cookie_new ()"><code class="function">soup_cookie_new()</code></a>
and <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()"><code class="function">soup_cookie_set_max_age()</code></a>.
</p>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-COOKIE-MAX-AGE-ONE-YEAR:CAPS"></a><h3>SOUP_COOKIE_MAX_AGE_ONE_YEAR</h3>
<pre class="programlisting">#define SOUP_COOKIE_MAX_AGE_ONE_YEAR (SOUP_COOKIE_MAX_AGE_ONE_DAY * 365.2422)
</pre>
<p>
A constant corresponding to 1 year, for use with <a class="link" href="SoupCookie.html#soup-cookie-new" title="soup_cookie_new ()"><code class="function">soup_cookie_new()</code></a>
and <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()"><code class="function">soup_cookie_set_max_age()</code></a>.
</p>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-expires"></a><h3>soup_cookie_set_expires ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_expires             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html#SoupDate"><span class="type">SoupDate</span></a> *expires</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s expiration time to <em class="parameter"><code>expires</code></em>. If <em class="parameter"><code>expires</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
<em class="parameter"><code>cookie</code></em> will be a session cookie and will expire at the end of the
client's session.
</p>
<p>
(This sets the same property as <a class="link" href="SoupCookie.html#soup-cookie-set-max-age" title="soup_cookie_set_max_age ()"><code class="function">soup_cookie_set_max_age()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>expires</code></em> :</span></p></td>
<td>the new expiration time, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-expires"></a><h3>soup_cookie_get_expires ()</h3>
<pre class="programlisting"><a class="link" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html#SoupDate"><span class="returnvalue">SoupDate</span></a> *          soup_cookie_get_expires             (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s expiration time
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s expiration time, which is
owned by <em class="parameter"><code>cookie</code></em> and should not be modified or freed. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-secure"></a><h3>soup_cookie_set_secure ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_secure              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> secure</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s secure attribute to <em class="parameter"><code>secure</code></em>. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <em class="parameter"><code>cookie</code></em> will
only be transmitted from the client to the server over secure
(https) connections.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>secure</code></em> :</span></p></td>
<td>the new value for the secure attribute</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-secure"></a><h3>soup_cookie_get_secure ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            soup_cookie_get_secure              (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s secure attribute
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s secure attribute</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-set-http-only"></a><h3>soup_cookie_set_http_only ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookie_set_http_only           (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> http_only</code></em>);</pre>
<p>
Sets <em class="parameter"><code>cookie</code></em>'s HttpOnly attribute to <em class="parameter"><code>http_only</code></em>. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <em class="parameter"><code>cookie</code></em>
will be marked as "http only", meaning it should not be exposed to
web page scripts or other untrusted code.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>http_only</code></em> :</span></p></td>
<td>the new value for the HttpOnly attribute</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-get-http-only"></a><h3>soup_cookie_get_http_only ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            soup_cookie_get_http_only           (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Gets <em class="parameter"><code>cookie</code></em>'s HttpOnly attribute
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>cookie</code></em>'s HttpOnly attribute</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-applies-to-uri"></a><h3>soup_cookie_applies_to_uri ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            soup_cookie_applies_to_uri          (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a> *uri</code></em>);</pre>
<p>
Tests if <em class="parameter"><code>cookie</code></em> should be sent to <em class="parameter"><code>uri</code></em>.
</p>
<p>
(At the moment, this does not check that <em class="parameter"><code>cookie</code></em>'s domain matches
<em class="parameter"><code>uri</code></em>, because it assumes that the caller has already done that.
But don't rely on that; it may change in the future.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>a <a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>cookie</code></em> should be sent to <em class="parameter"><code>uri</code></em>, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if
not</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-domain-matches"></a><h3>soup_cookie_domain_matches ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            soup_cookie_domain_matches          (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *host</code></em>);</pre>
<p>
Checks if the <em class="parameter"><code>cookie</code></em>'s domain and <em class="parameter"><code>host</code></em> match in the sense that
<em class="parameter"><code>cookie</code></em> should be sent when making a request to <em class="parameter"><code>host</code></em>, or that
<em class="parameter"><code>cookie</code></em> should be accepted when receiving a response from <em class="parameter"><code>host</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>host</code></em> :</span></p></td>
<td>a URI</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the domains match, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-to-cookie-header"></a><h3>soup_cookie_to_cookie_header ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              soup_cookie_to_cookie_header        (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Serializes <em class="parameter"><code>cookie</code></em> in the format used by the Cookie header (ie, for
returning a cookie from a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> to a server).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the header</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookie-to-set-cookie-header"></a><h3>soup_cookie_to_set_cookie_header ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              soup_cookie_to_set_cookie_header    (<em class="parameter"><code><a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> *cookie</code></em>);</pre>
<p>
Serializes <em class="parameter"><code>cookie</code></em> in the format used by the Set-Cookie header
(ie, for sending a cookie from a <a class="link" href="SoupServer.html" title="SoupServer"><span class="type">SoupServer</span></a> to a client).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>a <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the header</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-from-request"></a><h3>soup_cookies_from_request ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            soup_cookies_from_request           (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);</pre>
<p>
Parses <em class="parameter"><code>msg</code></em>'s Cookie request header and returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>s. As the "Cookie" header, unlike "Set-Cookie",
only contains cookie names and values, none of the other
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> fields will be filled in. (Thus, you can't generally
pass a cookie returned from this method directly to
<a class="link" href="SoupCookie.html#soup-cookies-to-response" title="soup_cookies_to_response ()"><code class="function">soup_cookies_to_response()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> containing a "Cookie" request header</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a>
of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>s, which can be freed with
<a class="link" href="SoupCookie.html#soup-cookies-free" title="soup_cookies_free ()"><code class="function">soup_cookies_free()</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-from-response"></a><h3>soup_cookies_from_response ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            soup_cookies_from_response          (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);</pre>
<p>
Parses <em class="parameter"><code>msg</code></em>'s Set-Cookie response headers and returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of
<a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>s. Cookies that do not specify "path" or
"domain" attributes will have their values defaulted from <em class="parameter"><code>msg</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> containing a "Set-Cookie" response header</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a>
of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>s, which can be freed with
<a class="link" href="SoupCookie.html#soup-cookies-free" title="soup_cookies_free ()"><code class="function">soup_cookies_free()</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-to-request"></a><h3>soup_cookies_to_request ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookies_to_request             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);</pre>
<p>
Adds the name and value of each cookie in <em class="parameter"><code>cookies</code></em> to <em class="parameter"><code>msg</code></em>'s
"Cookie" request. (If <em class="parameter"><code>msg</code></em> already has a "Cookie" request header,
these cookies will be appended to the cookies already present. Be
careful that you do not append the same cookies twice, eg, when
requeuing a message.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookies</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-to-response"></a><h3>soup_cookies_to_response ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookies_to_response            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>);</pre>
<p>
Appends a "Set-Cookie" response header to <em class="parameter"><code>msg</code></em> for each cookie in
<em class="parameter"><code>cookies</code></em>. (This is in addition to any other "Set-Cookie" headers
<em class="parameter"><code>msg</code></em> may already have.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookies</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-to-cookie-header"></a><h3>soup_cookies_to_cookie_header ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              soup_cookies_to_cookie_header       (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>);</pre>
<p>
Serializes a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a> into a string suitable for
setting as the value of the "Cookie" header.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookies</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the serialization of <em class="parameter"><code>cookies</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-cookies-free"></a><h3>soup_cookies_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_cookies_free                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *cookies</code></em>);</pre>
<p>
Frees <em class="parameter"><code>cookies</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cookies</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="SoupCookie.html" title="SoupCookie"><span class="type">SoupCookie</span></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> SoupCookie]</span>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
</div>
<div class="refsect1">
<a name="SoupCookie.see-also"></a><h2>See Also</h2>
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>